package com.event.management.backend.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 问卷模板数据传输对象
 */
@Data
@ApiModel(value = "问卷模板", description = "问卷模板信息")
public class QuestionnaireTemplateDTO {
    
    @ApiModelProperty(value = "模板ID")
    private Long id;
    
    @ApiModelProperty(value = "模板标题", required = true)
    @NotBlank(message = "模板标题不能为空")
    @Size(max = 100, message = "模板标题长度不能超过100个字符")
    private String title;
    
    @ApiModelProperty(value = "问卷说明")
    private String description;
    
    @ApiModelProperty(value = "题目列表", required = true)
    @NotEmpty(message = "问卷题目不能为空")
    @Valid
    private List<QuestionnaireQuestionDTO> questions;
    
    @ApiModelProperty(value = "创建者ID")
    private Long creatorId;
    
    @ApiModelProperty(value = "创建者姓名")
    private String creatorName;
    
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
} 